﻿namespace WebOptimizer.UI.Entities.Model
{
	public sealed partial class EntityFacade : global::WebOptimizer.Data.Model.EntityFacadeBase
	{
		#region Public Members

		#region SourceManager

		private global::WebOptimizer.Data.Model.EntityManagers.SourceManager<global::WebOptimizer.UI.Entities.Source, global::WebOptimizer.UI.Entities.SourceCollection> _SourceManager;
		public global::WebOptimizer.Data.Model.EntityManagers.SourceManager<global::WebOptimizer.UI.Entities.Source, global::WebOptimizer.UI.Entities.SourceCollection> SourceManager
		{
			get
			{
				if (_SourceManager == null)
				{
					lock (_mutex)
					{
						if (_SourceManager == null)
							_SourceManager = new global::WebOptimizer.Data.Model.EntityManagers.SourceManager<global::WebOptimizer.UI.Entities.Source, global::WebOptimizer.UI.Entities.SourceCollection>(this);
					}
				}
				return _SourceManager;
			}
		}

		#endregion
		#region TaskManager

		private global::WebOptimizer.Data.Model.EntityManagers.TaskManager<global::WebOptimizer.UI.Entities.Task, global::WebOptimizer.UI.Entities.TaskCollection> _TaskManager;
		public global::WebOptimizer.Data.Model.EntityManagers.TaskManager<global::WebOptimizer.UI.Entities.Task, global::WebOptimizer.UI.Entities.TaskCollection> TaskManager
		{
			get
			{
				if (_TaskManager == null)
				{
					lock (_mutex)
					{
						if (_TaskManager == null)
							_TaskManager = new global::WebOptimizer.Data.Model.EntityManagers.TaskManager<global::WebOptimizer.UI.Entities.Task, global::WebOptimizer.UI.Entities.TaskCollection>(this);
					}
				}
				return _TaskManager;
			}
		}

		#endregion
		
		#endregion
		#region Helper Members

		private static readonly object _mutex = new object();

		#endregion
		#region Constructors

		public EntityFacade() 
			: base(global::WebOptimizer.UI.Entities.Model.ResourceManager.Current)
		{
		}

		#endregion
	}
}